class Animal {
  runSpeed: number = 0
  constructor() { }

  setRunSpeed(runSpeed: number) {
    this.runSpeed = runSpeed
  }

  getRunSpeed() {
    return this.runSpeed
  }
}

/**
 * @description 可以飞的鸟
 */
class Bird extends Animal {
  flySpeed: number;

  constructor() {
    super()
  }

  setFlySpeed(flySpeed: number) {
    this.flySpeed = flySpeed
  }

  getFlySpeed() {
    return this.flySpeed
  }
}
/**
 * @description 燕子类
 */
class Swallow extends Bird { }

/**
 * @description 几维鸟,不能飞
 */
class KiwiBird extends Animal {
  getFlySpeed() {
    throw new Error("Method not implemented.");
  }
}


class LSPTest {
  main() {
    const swallow = new Swallow();
    const kiwiBird = new KiwiBird();

    swallow.setRunSpeed(120)
    swallow.setFlySpeed(300)

    kiwiBird.setRunSpeed(800)

    console.log(`燕子的奔跑速度是${swallow.getRunSpeed()}km/h, 飞行速度是${swallow.getFlySpeed()}km/h`)
    console.log(`几维鸟的奔跑速度是${kiwiBird.getRunSpeed()}km/h`)

  }
}

const lspTest = new LSPTest();
lspTest.main()
